//
//  CreditCardStore.m
//  NewPro
//
//  Created by RYX on 2019/6/21.
//  Copyright © 2019 何荧红. All rights reserved.
//

#import "CreditCardStore.h"

@implementation CreditCardStore

/**
 获取分享号
 */
- (void)getShareNoWithFlat:(NSString *)flat andShareTo:(NSString *)user andType:(NSString *)type success:(void(^)(NSString *shareNo))success failure:(void(^)(NSError *error))failure{
    
    NSString *url = [NSString stringWithFormat:@"%@/api/share",IP];
    NSDictionary *dic = @{
                          @"flat":flat,
                          @"type":type,
                          @"shareTo":@""
                          };
    [HttpTool postUrlWithString:url parameters:dic success:^(id responseObject) {
        
        NSError *error = [HttpTool inspectError:responseObject];
        if (error == nil) {
            
            NSString *no = responseObject[@"data"];
            success(no);
        }else{
            failure(error);
        }
    } failure:^(NSError *error){
        failure(error);
    }];
}
@end
